const state = {
  orders: [] // 每个订单包含商品列表、下单时间、状态等
};

const mutations = {
  addOrder(state, order) {
    state.orders.unshift(order);
  },
  clearOrders(state) {
    state.orders = [];
  }
};

const getters = {
  allOrders: state => state.orders,
};

export default {
  namespaced: true,
  state,
  mutations,
  getters
}; 